package com.ruoyi.hos.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.hos.domain.Floor;
import com.ruoyi.hos.mapper.FloorMapper;
import com.ruoyi.hos.service.IFloorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 楼Service业务层处理
 *
 * @author wpl
 * @date 2024-03-10
 */
@Service
public class FloorServiceImpl implements IFloorService
{
    @Autowired
    private FloorMapper floorMapper;

    /**
     * 查询楼
     *
     * @param id 楼主键
     * @return 楼
     */
    @Override
    public Floor selectFloorById(Long id)
    {
        return floorMapper.selectFloorById(id);
    }

    /**
     * 查询楼列表
     *
     * @param floor 楼
     * @return 楼
     */
    @Override
    public List<Floor> selectFloorList(Floor floor)
    {
        return floorMapper.selectFloorList(floor);
    }

    /**
     * 新增楼
     *
     * @param floor 楼
     * @return 结果
     */
    @Override
    public int insertFloor(Floor floor)
    {
        floor.setCreateTime(DateUtils.getNowDate());
        return floorMapper.insertFloor(floor);
    }

    /**
     * 修改楼
     *
     * @param floor 楼
     * @return 结果
     */
    @Override
    public int updateFloor(Floor floor)
    {
        floor.setUpdateTime(DateUtils.getNowDate());
        return floorMapper.updateFloor(floor);
    }

    /**
     * 批量删除楼
     *
     * @param ids 需要删除的楼主键
     * @return 结果
     */
    @Override
    public int deleteFloorByIds(Long[] ids)
    {
        return floorMapper.deleteFloorByIds(ids);
    }

    /**
     * 删除楼信息
     *
     * @param id 楼主键
     * @return 结果
     */
    @Override
    public int deleteFloorById(Long id)
    {
        return floorMapper.deleteFloorById(id);
    }
}
